package com.nancy.java_design.abstract_factory.demo2;


/**
 * 易于拓展，下次添加什么类型的咖啡，直接在配置文件中添加即可，不用修改工厂类
 */
public class Test {
    public static void main(String[] args) {
        //生产美式咖啡
        CoffeeFactory coffeeFactory = new CoffeeFactory();
        Coffee coffee = coffeeFactory.getCoffee("americanCoffee");
        System.out.println(coffee.getName());

        //生产拿铁咖啡
        coffee = coffeeFactory.getCoffee("latte");
        System.out.println(coffee.getName());

    }
}
